***GENDER AND MOBILE MONEY PROJECT, 2020
***REPLICATION DO FILE - MAIN AND SUPPLEMENTARY ANALYSES

***Mahesh Karra - 2025-08-09

***STEP 0: SETTING WORKING DIRECTORY
***To use the correct file directory, replace "maindir" with the appropriate file path under which your Dropbox folder is stored.


version 13

if "`c(username)'"=="mvkarra" {
                global maindir "C:\Users\mvkarra\Documents\BU 2019-2020\FALL 2019\GENDER AND MOBILE MONEY\SUBMISSIONS\JDS\REPLICATION"
}
else if "`c(username)'"=="[another username here]" {
                global maindir "[directory here]"
}
 
set excelxlsxlargefile on

***COMMANDS TO INSTALL TO RUN ANALYSIS
*ESTOUT: OUTPUT COMMAND TO LATEX
cap ssc install estout, replace
*BALANCETABLE: BALANCE TABLE SUMMARY STATISTICS
cap ssc install balancetable, replace
*ITSA: INTERRUPTED TIME SERIES ANALYSIS
*cap ssc install itsa, replace
*RITEST: RANDOMIZATION INFERENCE TEST
cap ssc install ritest, replace
*RWOLF2: ROMANO-WOLF MHT
cap ssc install rwolf2, replace

***ANALYSIS

***CHANGE DIRECTORY TO SAVE RESULTS IN THE RESULTS SUB-FOLDER
cd "$maindir\RESULTS"


********************************************************************************
********************************************************************************

use "$maindir\DATA\Table_A1.dta", clear

********************************
***BALANCE TABLES BY TSR GENDER
********************************

*KEEP
***TABLE A1: BALANCE BY TSR_GENDER
balancetable tsr_gender_n Anchilo Chiequele Elipisse Marratane Moacoanvela Murriase Murrupula Nameteca Namiepe Rapale far_market Sunday Monday Tuesday Wednesday Thursday Friday Saturday using "Table_A1.tex", varlabels replace wide(mean diff) ///
            ctitles("TSR Male" "TSR Female" "Difference (F - M)") ///
			prehead("\begin{table}\begin{center}\caption{Balance Table of Team Visits by TSR Team Gender}\label{tab: TableA1}\tabcolsep=0.1cm\begin{tabular}{lccc}\toprule") posthead("\midrule") ///
			prefoot("\midrule") postfoot("\bottomrule\end{tabular}\end{center}\footnotesize{*** p < 0.01, ** p < 0.05, * p < 0.1.\\The unit of observation is the group-day (for example, Female TSR Group A on December 15, 2018 or Male TSR Group B on January 3, 2019).}\end{table}")
**JOINT TEST
reg tsr_gender_n Anchilo Chiequele Elipisse Marratane Moacoanvela Murriase Murrupula Nameteca Namiepe Rapale far_market Sunday Monday Tuesday Wednesday Thursday Friday Saturday
testparm Anchilo Chiequele Elipisse Marratane Moacoanvela Murriase Murrupula Nameteca Namiepe Rapale far_market Sunday Monday Tuesday Wednesday Thursday Friday Saturday

********************************************************************************
********************************************************************************

***USE CLEAN FILE
use "$maindir\DATA\Table_A7.dta", clear

********************************************************************************
********************************************************************************

***ITT ANALYSIS, TRANSACTION LEVEL OUTCOMES

***CHANGE DIRECTORY TO SAVE RESULTS
cd "$maindir\RESULTS"

*******************************************************
****REGRESSIONS
*******************************************************


global covariates "ib1.age_group sub_sex ib1.market ib0.day_wk no_wks_enrolled incentive"
global covariates_2 "ib1.age_group sub_sex ib1.market ib0.day_wk incentive"


*KEEP
***TABLE A7: CLIENT REGRESSIONS WITH TREATMENT AMONG M4A GROUPS, INTERACTED WITH GENDER

eststo clear
eststo: reg EW_tot_num_f i.treatment##sub_sex##i.far_market $covariates_2 if c_t==1 & uniq_sid==1 & uniq_first_8_wks==1, vce(cluster market_day)
sum EW_tot_num_f if treatment==0
estadd scalar ymean = r(mean)
test _b[1.treatment]=_b[2.treatment]
estadd scalar ts_1 = r(F)
estadd scalar pval_1 = r(p)
test _b[1.treatment#1.sub_sex]=_b[2.treatment#1.sub_sex]
estadd scalar ts_2 = r(F)
estadd scalar pval_2 = r(p)
eststo: reg EW_tot_val_f i.treatment##sub_sex##i.far_market $covariates_2 if c_t==1 & uniq_sid==1 & uniq_first_8_wks==1, vce(cluster market_day)
sum EW_tot_val_f if treatment==0
estadd scalar ymean = r(mean)
test _b[1.treatment]=_b[2.treatment]
estadd scalar ts_1 = r(F)
estadd scalar pval_1 = r(p)
test _b[1.treatment#1.sub_sex]=_b[2.treatment#1.sub_sex]
estadd scalar ts_2 = r(F)
estadd scalar pval_2 = r(p)
eststo: reg FW_tot_num_f i.treatment##sub_sex##i.far_market $covariates_2 if c_t==1 & uniq_sid==1 & uniq_last_4_wks==1, vce(cluster market_day)
sum FW_tot_num_f if treatment==0
estadd scalar ymean = r(mean)
test _b[1.treatment]=_b[2.treatment]
estadd scalar ts_1 = r(F)
estadd scalar pval_1 = r(p)
test _b[1.treatment#1.sub_sex]=_b[2.treatment#1.sub_sex]
estadd scalar ts_2 = r(F)
estadd scalar pval_2 = r(p)
eststo: reg FW_tot_val_f i.treatment##sub_sex##i.far_market $covariates_2 if c_t==1 & uniq_sid==1 & uniq_last_4_wks==1, vce(cluster market_day)
sum FW_tot_val_f if treatment==0
estadd scalar ymean = r(mean)
test _b[1.treatment]=_b[2.treatment]
estadd scalar ts_1 = r(F)
estadd scalar pval_1 = r(p)
test _b[1.treatment#1.sub_sex]=_b[2.treatment#1.sub_sex]
estadd scalar ts_2 = r(F)
estadd scalar pval_2 = r(p)


esttab est1 est2 est3 est4 using "Table_A7.tex", replace fragment label nonumbers nolines cells(b(star fmt(%9.3f)) ///
ci(par("[" ", " "]") fmt(%9.3f))) starlevels(* 0.1 ** 0.05 *** 0.01) compress style(tab) keep(2.treatment 1.sub_sex 1.far_market 2.treatment#1.sub_sex 2.treatment#1.far_market 2.treatment#1.sub_sex#1.far_market) substitute("=1" "" "=2" "") collabels(none) ///
stats(N ymean pval_1 pval_2, fmt(0 2 2 2) labels("Observations" "Control Mean" "\shortstack{p-value: Male TSR = Female TSR\\for Male Clients - Over Last 8 Weeks}" "\shortstack{p-value: Male TSR = Female TSR\\for Female Clients}")) ///
prehead("\begin{sidewaystable}[htb] \begin{center} \caption{Analysis of Treatment Male TSR versus Treatment Female TSR, Interaction with Client Sex and Rural Client} \label{tab: TableA7} \begin{adjustbox}{max width=\textwidth,max height=\textheight} \tabcolsep=0.1cm \makeatletter \providecommand{\tabularnewline}{\\} \makeatother \begin{tabular}{lcccc}\toprule") ///
posthead("\midrule") ///
postfoot("\midrule Controls & $\checkmark$ & $\checkmark$ & $\checkmark$ & $\checkmark$ \tabularnewline Market FE & $\checkmark$ & $\checkmark$ & $\checkmark$ & $\checkmark$ \tabularnewline Day of Week FE & $\checkmark$ & $\checkmark$ & $\checkmark$ & $\checkmark$ \tabularnewline \bottomrule \end{tabular} \end{adjustbox} \end{center} Notes: The unit of analysis is the client. All models are estimated using ordinary least squares, with 95 percent confidence intervals presented in brackets. Covariates include: age (in four age groups), whether the incentive was implemented, and market and day of the week fixed effects. Standard errors are clustered at the market-day level. *** p < 0.01, ** p < 0.05, * p < 0.1. \end{sidewaystable}") nogaps ///
mtitles("\shortstack{Total No. of Transactions\\in First 8 Wks.}" "\shortstack{Total Value of Transactions\\in First 8 Wks.}" "\shortstack{No. of Transactions\\in Last 4 Wks.}" "\shortstack{Value of Transactions\\in Last 4 Wks.}")


********************************************************************************
***INTERRUPTED TIME SERIES ANALYSIS GRAPHS
********************************************************************************

***WEEK ENROLLED
use "$maindir\DATA\Table_A3.dta", clear

**LABEL VARIABLES
label var no_wks_enr "Weeks Enrolled"
label var avg_num_wk_en "Average Number of Transactions / Week"
label var avg_val_wk_en "Average Value of Transactions / Week"
label var treatment "Treatment"

***PANEL SET
tsset treatment no_wks_enr

itsa avg_num_wk_enr, treat(1) trperiod(13) figure replace posttrend
itsa avg_val_wk_enr, treat(1) trperiod(13) figure replace posttrend

eststo clear
eststo: itsa avg_num_wk_en, treat(1) trperiod(13) figure(title("Avg. Num. of Transactions - Male TSR vs. Female TSR") subtitle("Incentive: Week 13")) replace posttrend
gr_edit .legend.plotregion1.label[4].text = {}
gr_edit .legend.plotregion1.label[4].text.Arrpush Male TSR:
gr_edit .note.text = {}
gr_edit .title.text = {}
eststo: itsa avg_val_wk_en, treat(1) trperiod(13) figure(title("Avg. Val. of Transactions - Male TSR vs. Female TSR") subtitle("Incentive: Week 13")) replace posttrend
gr_edit .legend.plotregion1.label[4].text = {}
gr_edit .legend.plotregion1.label[4].text.Arrpush Male TSR:
gr_edit .note.text = {}
gr_edit .title.text = {}

*KEEP
***TABLE A3
esttab est1 est2 using "Table_A3.tex", replace fragment label nonumbers nolines cells(b(star fmt(%9.3f)) ///
ci(par("[" ", " "]") fmt(%9.3f))) starlevels(* 0.1 ** 0.05 *** 0.01) compress style(tab) substitute("_z_x_t13" "Female TSR $\times$ Time $\times$ Incentive" "_z_x13" "Female TSR $\times$ Incentive" "_x_t13" "Time $\times$ Incentive" "_z_t" "Female TSR $\times$ Time" "_t" "Time (Week)" "_z" "Female TSR" "_x13" "Incentive") collabels(none) ///
stats(N, fmt(0) labels("Observations")) ///
prehead("\begin{sidewaystable}[htb] \begin{center} \caption{ITS Analysis of Incentive - Week Enrolled} \label{tab: TableA3} \begin{adjustbox}{max width=\textwidth,max height=\textheight} \tabcolsep=0.1cm \makeatletter \providecommand{\tabularnewline}{\\} \makeatother \begin{tabular}{lccc}\toprule") ///
posthead("\midrule") ///
postfoot("\bottomrule \end{tabular} \end{adjustbox} \end{center} Notes: The unit of analysis is the week enrolled by TSR gender, where average outcomes are calculated for each week by TSR gender. All models are estimated using interrupted time series specifications to identify the impact of the introduction of the M4A incentive, with 95 percent confidence intervals presented in brackets. The variable Female TSR is a binary indicator for TSR gender, the variable Time indicates the week (weeks 1-17), and the variable Incentive is a binary indicator for the introduction of the incentive.  *** p < 0.01, ** p < 0.05, * p < 0.1. \end{sidewaystable}") nogaps ///
mtitles("\shortstack{No. of Transactions\\per Week}" "\shortstack{Value of Transactions\\per Week}")
eststo clear

********************************************************************************
***DAY ITSA ANALYSIS
********************************************************************************

use "$maindir\DATA\Table_3_4_Fig_2_B1_B2.dta", clear


**LABEL VARIABLES
label var day "Day"
label var mpesa_conv "Avg. M-Pesa Conversion Rate"
label var fem_mpesa_conv "Avg. M-Pesa Conversion Rate - Female Clients"
label var rur_mpesa_conv "Avg. M-Pesa Conversion Rate - Rural Clients"
label var rur_fem_mpesa_conv "Avg. M-Pesa Conversion Rate - Rural Female Clients"
label var tot_clients_d "No. of New Clients"
label var tot_mpesa_clients_d "No. of New M-Pesa Clients"
label var tot_mpesa_use_d "Total No. of M-Pesa Accounts Used"
label var tot_fem_clients_d "No. of New Female Clients"
label var tot_rur_clients_d "No. of New Rural Clients"
label var tot_rur_fem_clients_d "No. of New Rural Female Clients"
label var tot_fem_mpesa_clients_d "No. of New Female M-Pesa Clients"
label var tot_rur_mpesa_clients_d "No. of New Rural M-Pesa Clients"
label var tot_rur_fem_mpesa_clients_d "No. of New Rural Female M-Pesa Clients"
label var tot_fem_mpesa_use_d "Total No. of Female M-Pesa Accounts Used"
label var tot_rur_mpesa_use_d "Total No. of Rural M-Pesa Accounts Used"
label var tot_rur_fem_mpesa_use_d "Total No. of Rural M-Pesa Accounts Used"
label var treatment "Treatment"
label define treatment_l 0 "Male TSR" 1 "Female TSR"
label values treatment treatment_l

rename tot_rur_fem_mpesa_use_d tot_rur_fem_muse_d

replace day = day - 21532

*INDICATOR OF INCENTIVE INTRODUCTION - DAY 82
gen intro_incentive = day >= 82
label var intro_incentive "Incentive"

***DROP DAYS WITH ONLY ONE TREATMENT OBSERVATION
bysort day: gen count_days = _N
drop if count_days!=2

***PANEL SET
tsset treatment day

eststo clear
itsa tot_clients_d, treat(1) trperiod(83) figure replace posttrend
eststo: itsa mpesa_conv, treat(1) trperiod(83) figure(title("M-Pesa Conversion Rate - Male TSR vs. Female TSR") subtitle("Incentive: Day 83")) replace posttrend
gr_edit .legend.plotregion1.label[4].text = {}
gr_edit .legend.plotregion1.label[4].text.Arrpush Male TSR:
gr_edit .note.text = {}
gr_edit .title.text = {}

eststo: itsa tot_clients_d, treat(1) trperiod(83) figure(title("No. of New Clients - Male TSR vs. Female TSR") subtitle("Incentive: Day 83")) replace posttrend
gr_edit .legend.plotregion1.label[4].text = {}
gr_edit .legend.plotregion1.label[4].text.Arrpush Male TSR:
gr_edit .note.text = {}
gr_edit .title.text = {}

*KEEP
********************************************************************************
***FIGURE 2
********************************************************************************
eststo: itsa tot_mpesa_clients_d, treat(1) trperiod(83) figure(title("No. of New M-Pesa Clients - Male TSR vs. Female TSR") subtitle("Incentive: Day 83") saving(Figure_2, replace)) replace posttrend
gr_edit .legend.plotregion1.label[4].text = {}
gr_edit .legend.plotregion1.label[4].text.Arrpush Male TSR:
gr_edit .note.text = {}
gr_edit .title.text = {}
gr export Figure_2.pdf, as(pdf)  replace


eststo: itsa tot_fem_clients_d, treat(1) trperiod(83) figure(title("No. of New Female Clients - Male TSR vs. Female TSR") subtitle("Incentive: Day 83")) replace posttrend
gr_edit .legend.plotregion1.label[4].text = {}
gr_edit .legend.plotregion1.label[4].text.Arrpush Male TSR:
gr_edit .note.text = {}
gr_edit .title.text = {}

*KEEP
********************************************************************************
*FIGURE B1
********************************************************************************
eststo: itsa tot_fem_mpesa_clients_d, treat(1) trperiod(83) figure(title("No. of New Female M-Pesa Clients - Male TSR vs. Female TSR") subtitle("Incentive: Day 83") saving(Figure_B1, replace)) replace posttrend
gr_edit .legend.plotregion1.label[4].text = {}
gr_edit .legend.plotregion1.label[4].text.Arrpush Male TSR:
gr_edit .note.text = {}
gr_edit .title.text = {}
gr export Figure_B1.pdf, as(pdf)  replace
eststo: itsa tot_rur_clients_d, treat(1) trperiod(83) figure(title("No. of New Rural Clients - Male TSR vs. Female TSR") subtitle("Incentive: Day 83")) replace posttrend
gr_edit .legend.plotregion1.label[4].text = {}
gr_edit .legend.plotregion1.label[4].text.Arrpush Male TSR:
gr_edit .note.text = {}
gr_edit .title.text = {}
eststo: itsa tot_rur_mpesa_clients_d, treat(1) trperiod(83) figure(title("No. of New Rural M-Pesa Clients - Male TSR vs. Female TSR") subtitle("Incentive: Day 83")) replace posttrend
gr_edit .legend.plotregion1.label[4].text = {}
gr_edit .legend.plotregion1.label[4].text.Arrpush Male TSR:
gr_edit .note.text = {}
gr_edit .title.text = {}
eststo: itsa tot_rur_fem_clients_d, treat(1) trperiod(83) figure(title("No. of New Rural Female Clients - Male TSR vs. Female TSR") subtitle("Incentive: Day 83")) replace posttrend
gr_edit .legend.plotregion1.label[4].text = {}
gr_edit .legend.plotregion1.label[4].text.Arrpush Male TSR:
gr_edit .note.text = {}
gr_edit .title.text = {}

*KEEP
********************************************************************************
*FIGURE B2
********************************************************************************
eststo: itsa tot_rur_fem_muse_d, treat(1) trperiod(83) figure(title("No. of New Rural Female M-Pesa Clients - Male TSR vs. Female TSR") subtitle("Incentive: Day 83") saving(Figure_B2, replace)) replace posttrend
gr_edit .legend.plotregion1.label[4].text = {}
gr_edit .legend.plotregion1.label[4].text.Arrpush Male TSR:
gr_edit .note.text = {}
gr_edit .title.text = {}
gr export Figure_B2.pdf, as(pdf)  replace
eststo: itsa tot_mpesa_use_d, treat(1) trperiod(83) figure(title("No. of M-Pesa Accounts Used - Male TSR vs. Female TSR") subtitle("Incentive: Day 83")) replace posttrend
gr_edit .legend.plotregion1.label[4].text = {}
gr_edit .legend.plotregion1.label[4].text.Arrpush Male TSR:
gr_edit .note.text = {}
gr_edit .title.text = {}

*KEEP
***TABLE 3: ITSA ANALYSIS, PART 1
esttab est3 est5 est7 est9 using "Table_3.tex", replace fragment label nonumbers nolines cells(b(star fmt(%9.3f)) ///
ci(par("[" ", " "]") fmt(%9.3f))) starlevels(* 0.1 ** 0.05 *** 0.01) compress style(tab) substitute("_z_x_t83" "Female TSR $\times$ Time $\times$ Incentive" "_z_x83" "Female TSR $\times$ Incentive" "_x_t83" "Time $\times$ Incentive" "_z_t" "Female TSR $\times$ Time" "_t" "Time (Week)" "_z" "Female TSR" "_x83" "Incentive") collabels(none) ///
stats(N, fmt(0) labels("Observations")) ///
prehead("\begin{sidewaystable}[htb] \begin{center} \caption{ITS Analysis of Incentive - Day} \label{tab: Table3} \begin{adjustbox}{max width=\textwidth,max height=\textheight} \tabcolsep=0.1cm \makeatletter \providecommand{\tabularnewline}{\\} \makeatother \begin{tabular}{lccccc}\toprule") ///
posthead("\midrule") ///
postfoot("\bottomrule \end{tabular} \end{adjustbox} \end{center} Notes: The unit of analysis is the day by TSR gender, where average outcomes are calculated for each day by TSR gender. All models are estimated using interrupted time series specifications to identify the impact of the introduction of the M4A incentive, with 95 percent confidence intervals presented in brackets. The variable Female TSR is a binary indicator for TSR gender, the variable Time indicates the day (days 1-152), and the variable Incentive is a binary indicator for the introduction of the incentive.  *** p < 0.01, ** p < 0.05, * p < 0.1. \end{sidewaystable}") nogaps ///
mtitles("\shortstack{No. of New M-Pesa\\Clients per Day}" "\shortstack{No. of New Female M-Pesa\\Clients per Day}" "\shortstack{No. of New Rural M-Pesa\\Clients per Day}" "\shortstack{No. of New Rural Female M-Pesa\\Clients per Day}")

*KEEP
***TABLE 4: ITSA ANALYSIS, PART 2
esttab est2 est10 est1 using "Table_4.tex", replace fragment label nonumbers nolines cells(b(star fmt(%9.3f)) ///
ci(par("[" ", " "]") fmt(%9.3f))) starlevels(* 0.1 ** 0.05 *** 0.01) compress style(tab) substitute("_z_x_t83" "Female TSR $\times$ Time $\times$ Incentive" "_z_x83" "Female TSR $\times$ Incentive" "_x_t83" "Time $\times$ Incentive" "_z_t" "Female TSR $\times$ Time" "_t" "Time (Week)" "_z" "Female TSR" "_x83" "Incentive") collabels(none) ///
stats(N, fmt(0) labels("Observations")) ///
prehead("\begin{sidewaystable}[htb] \begin{center} \caption{ITS Analysis of Incentive - Day} \label{tab: Table4} \begin{adjustbox}{max width=\textwidth,max height=\textheight} \tabcolsep=0.1cm \makeatletter \providecommand{\tabularnewline}{\\} \makeatother \begin{tabular}{lcccc}\toprule") ///
posthead("\midrule") ///
postfoot("\bottomrule \end{tabular} \end{adjustbox} \end{center} Notes: The unit of analysis is the day by TSR gender, where average outcomes are calculated for each day by TSR gender. All models are estimated using interrupted time series specifications to identify the impact of the introduction of the M4A incentive, with 95 percent confidence intervals presented in brackets. The variable Female TSR is a binary indicator for TSR gender, the variable Time indicates the day (days 1-152), and the variable Incentive is a binary indicator for the introduction of the incentive.  *** p < 0.01, ** p < 0.05, * p < 0.1. \end{sidewaystable}") nogaps ///
mtitles("\shortstack{New SIM Accounts\\per Day}" "\shortstack{M-Pesa Accounts Used\\per Day}" "\shortstack{M-Pesa Conversion Rate\\per Week}")
eststo clear


********************************************************************************
********************************************************************************


***ITT ANALYSIS, MARKET-DAY-LEVEL ANALYSES

use "$maindir\DATA\Table_1_2_A4_A5_A6_A9_B3_B4.dta", clear

***CHANGE DIRECTORY TO SAVE RESULTS
cd "$maindir\RESULTS"

***MERGE IN MARKET DAY DATA
merge m:1 market day using "$maindir\DATA\TSR_TEST_SCORES.dta"


***GENERATE TREATMENT VARIABLES
gen c_t = treatment==0
gen tsr_gender = treatment==2
replace tsr_gender = . if treatment==0

*INDICATOR OF INCENTIVE INTRODUCTION
gen day_r = mod(market_day,1000)
gen intro_incentive = day_r >= 82

***GENERATE INCENTIVE PERIODS
gen incentive_day = day_r >= 82
label var incentive_day "Incentive (1 = Yes)"

***LABEL VARIABLES
label var market_day "Market Day"
label var day_wk "Day of the Week"
label var num "Number of Transactions"
label var val "Value of Transactions"
label var sub_sex "Client Sex"
label var sub_yob "Client Year of Birth"
label var tot_num "Total Number of Transactions"
label var tot_val "Total Value of Transactions"
label var tot_trans_wks "Total Number of Transactions Made"
label var tot_clients_md "Total No. of Clients, Mkt. Day"
label var tot_clients_d "Total No. of Clients, Day"
label var tot_mpesa_clients_md "Total No. of M-Pesa Clients, Mkt. Day"
label var tot_mpesa_clients_d "Total No. of M-Pesa Clients, Day"
label var tot_mpesa_use_md "Total M-Pesa use, Mkt. Day"
label var tot_mpesa_use_d "Total M-Pesa Use, Day"
label var tot_mpesa_use_4_wks_md "Tot. M-Pesa use in last 4 Wks, Mkt. Day"
label var tot_mpesa_use_4_wks_d "Tot. M-Pesa use in last 4 Wks, Mkt. Day"
label var mpesa_conv "M-Pesa Conversion Rate"
label var fem_mpesa_conv "Female M-Pesa Conversion Rate"
label var rur_mpesa_conv "Rural M-Pesa Conversion Rate"
label var rur_fem_mpesa_conv "Rural Female M-Pesa Conversion Rate"
label var days_to_convert "Days to Convert" 
label var conv_within_one_wk "Convert within 1 Wk"
label var conv_same_day "Convert on Same Day"
label var fem_conv_within_one_wk "Female Convert within 1 Wk"
label var fem_conv_same_day "Female Convert on Same Day"
label var rur_conv_within_one_wk "Rural Convert within 1 Wk"
label var rur_conv_same_day "Rural Convert on Same Day"
label var rur_fem_conv_within_one_wk "Rural Female Convert within 1 Wk"
label var rur_fem_conv_same_day "Rural Female Convert on Same Day"
label var no_wks_enrolled "No. of Wks. Enrolled"
label var market "Market"
label var avg_num "Avg. Number of Transactions"
label var avg_val "Avg. Value of Transactions"
label var treatment "Treatment"
label var c_t "Comparison vs. M4A"
label var tsr_gender "TSR Gender"
label var far_market "Market is far (1 = Yes)"
label var incentive "Incentive (1 = Yes)"

*FEMALE
label var tot_fem_clients_md "Total female clients, market-day"
label var tot_fem_clients_d "Total female clients, day"
label var tot_fem_mpesa_clients_md "Total female M-Pesa Clients, market-day"
label var tot_fem_mpesa_clients_d "Total female M-Pesa Clients, day"
label var tot_fem_mpesa_use_md "Total female M-Pesa Use, market-day"
label var tot_fem_mpesa_use_d "Total female M-Pesa Use, day"
label var tot_fem_mpesa_use_4_wks_md "Total female M-Pesa Use in Last 4 Wks, market-day"
label var tot_fem_mpesa_use_4_wks_d "Total female M-Pesa Use in Last 4 Wks, day"
*RURAL
label var tot_rur_clients_md "Total rural clients, market-day"
label var tot_rur_clients_d "Total rural clients, day"
label var tot_rur_mpesa_clients_md "Total rural M-Pesa Clients, market-day"
label var tot_rur_mpesa_clients_d "Total rural M-Pesa Clients, day"
label var tot_rur_mpesa_use_md "Total rural M-Pesa Use, market-day"
label var tot_rur_mpesa_use_d "Total rural M-Pesa Use, day"
label var tot_rur_mpesa_use_4_wks_md "Total rural M-Pesa Use in Last 4 Wks, market-day"
label var tot_rur_mpesa_use_4_wks_d "Total rural M-Pesa Use in Last 4 Wks, day"
*RURAL FEMALE
label var tot_rur_fem_clients_md "Total rural female clients, market-day"
label var tot_rur_fem_clients_d "Total rural female clients, day"
label var tot_rur_fem_mpesa_clients_md "Total rural female M-Pesa Clients, market-day"
label var tot_rur_fem_mpesa_clients_d "Total rural female M-Pesa Clients, day"
label var tot_rur_fem_mpesa_use_md "Total rural female M-Pesa Use, market-day"
label var tot_rur_fem_mpesa_use_d "Total rural female M-Pesa Use, day"
label var tot_rur_fem_mpesa_use_4_wks_md "Total rural female M-Pesa Use in Last 4 Wks, market-day"
label var tot_rur_fem_mpesa_use_4_wks_d "Total rural female M-Pesa Use in Last 4 Wks, day"


*KEEP
***TABLE 1: COMPARISON OF OUTCOMES
balancetable tsr_gender tot_clients_md tot_mpesa_clients_md tot_mpesa_use_md tot_mpesa_use_4_wks_md mpesa_conv conv_within_one_wk avg_num avg_val sub_sex using "Table_1.tex" if market_day!=. & c_t==0, varlabels replace wide(mean diff) ///
            ctitles("Male TSR" "Female TSR" "Difference (F - M)") ///
			prehead("\begin{table}\begin{center}\caption{Comparison of Outcomes by Male TSR Group and Female TSR Group, Market-Day Level}\label{tab: Table1}\tabcolsep=0.1cm\begin{tabular}{lccc}\toprule") posthead("\midrule") ///
			prefoot("\midrule") postfoot("\bottomrule\end{tabular}\end{center}\footnotesize{*** p < 0.01, ** p < 0.05, * p < 0.1.\\The unit of observation is the market-day.}\end{table}")
**JOINT TEST
reg tsr_gender tot_clients_md tot_mpesa_clients_md tot_mpesa_use_md tot_mpesa_use_4_wks_md mpesa_conv conv_within_one_wk avg_num avg_val sub_sex
testparm tsr_gender tot_clients_md tot_mpesa_clients_md tot_mpesa_use_md tot_mpesa_use_4_wks_md mpesa_conv conv_within_one_wk avg_num avg_val sub_sex


*KEEP
***TABLE A4: COMPARISON OF OUTCOMES BEFORE AND AFTER INCENTIVE WAS INTRODUCED

balancetable intro_incentive tot_clients_md tot_mpesa_clients_md tot_mpesa_use_md tot_mpesa_use_4_wks_md mpesa_conv conv_within_one_wk avg_num avg_val sub_sex using "Table_A4.tex" if tsr_gender==1 & market_day!=., varlabels replace wide(mean diff) ///
            ctitles("\shortstack{Before Incentive}" "\shortstack{After Incentive}" "\shortstack{Difference\\(After - Before)}") ///
			prehead("\begin{table}\begin{center}\caption{Comparison of Outcomes within TSR Groups Pre- and Post-Incentive, Market-Day Level}\label{tab: TableA4}\tabcolsep=0.1cm\begin{tabular}{lccc}\toprule") ///
			posthead("\midrule \multicolumn{2}{l}{\textbf{A: Female TSRs}} \\")

balancetable intro_incentive tot_clients_md tot_mpesa_clients_md tot_mpesa_use_md tot_mpesa_use_4_wks_md mpesa_conv conv_within_one_wk avg_num avg_val sub_sex using "Table_A4.tex" if tsr_gender==0 & market_day!=., varlabels append wide(mean diff) ///
			prehead("") ///
			posthead("\midrule \multicolumn{2}{l}{\textbf{B: Male TSRs}} \\") ///
			prefoot("\midrule") postfoot("\bottomrule\end{tabular}\end{center}\footnotesize{*** p < 0.01, ** p < 0.05, * p < 0.1.\\The unit of observation is the market-day.}\end{table}")


***COVARIATES
global covariates_2 "ib1.market ib0.day_wk i.incentive_day"
global covariates "ib1.market ib0.day_wk"

label define treatment_l 0 "Comparison" 1 "Male TSR" 2 "Female TSR"
label values treatment treatment_l

*KEEP
****************************************
***TABLE 2: MAIN RESULTS, CLIENT SEX, AND RURAL OUTCOMES
****************************************

global covariates_3 "ib1.market ib0.day_wk i.incentive_day"

eststo clear

***MAIN OUTCOMES ACROSS TSR TREATMENTS ONLY

eststo: reg tot_clients_md i.treatment $covariates_2 if treatment > 0, robust
sum tot_clients_md if treatment==1
estadd scalar ymean = r(mean)
eststo: reg tot_mpesa_clients_md i.treatment $covariates_2 if treatment > 0, robust
sum tot_mpesa_clients_md if treatment==1
estadd scalar ymean = r(mean)
eststo: reg tot_mpesa_use_md i.treatment $covariates_2 if treatment > 0, robust
sum tot_mpesa_use_md if treatment==1
estadd scalar ymean = r(mean)
eststo: reg mpesa_conv i.treatment $covariates_2 if treatment > 0, robust
sum mpesa_conv if treatment==1
estadd scalar ymean = r(mean)

*CLIENT SEX
eststo: reg tot_fem_clients_md i.treatment $covariates_3 if treatment > 0, robust
sum tot_fem_clients_md if treatment==1
estadd scalar ymean = r(mean)
eststo: reg tot_fem_mpesa_clients_md i.treatment $covariates_3 if treatment > 0, robust
sum tot_fem_mpesa_clients_md if treatment==1
estadd scalar ymean = r(mean)
eststo: reg tot_fem_mpesa_use_md i.treatment $covariates_3 if treatment > 0, robust
sum tot_fem_mpesa_use_md if treatment==1
estadd scalar ymean = r(mean)
eststo: reg fem_mpesa_conv i.treatment $covariates_2 if treatment > 0, robust
sum fem_mpesa_conv if treatment==1
estadd scalar ymean = r(mean)
	
*RURAL CLIENT
eststo: reg tot_rur_clients_md i.treatment $covariates_3 if treatment > 0, robust
sum tot_rur_clients_md if treatment==1
estadd scalar ymean = r(mean)
eststo: reg tot_rur_mpesa_clients_md i.treatment $covariates_3 if treatment > 0, robust
sum tot_rur_mpesa_clients_md if treatment==1
estadd scalar ymean = r(mean)
eststo: reg tot_rur_mpesa_use_md i.treatment $covariates_3 if treatment > 0, robust
sum tot_rur_mpesa_use_md if treatment==1
estadd scalar ymean = r(mean)
eststo: reg rur_mpesa_conv i.treatment $covariates_2 if treatment > 0, robust
sum rur_mpesa_conv if treatment==1
estadd scalar ymean = r(mean)

*RURAL FEMALE CLIENT
eststo: reg tot_rur_fem_clients_md i.treatment $covariates_3 if treatment > 0, robust
sum tot_rur_fem_clients_md if treatment==1
estadd scalar ymean = r(mean)
eststo: reg tot_rur_fem_mpesa_clients_md i.treatment $covariates_3 if treatment > 0, robust
sum tot_rur_fem_mpesa_clients_md if treatment==1
estadd scalar ymean = r(mean)
eststo: reg tot_rur_fem_mpesa_use_md i.treatment $covariates_3 if treatment > 0, robust
sum tot_rur_fem_mpesa_use_md if treatment==1
estadd scalar ymean = r(mean)
eststo: reg rur_fem_mpesa_conv i.treatment $covariates_2 if treatment > 0, robust
sum rur_fem_mpesa_conv if treatment==1
estadd scalar ymean = r(mean)
	
*PANEL A: ALL CLIENTS
esttab est1 est2 est3 est4 using "Table_2_F.tex", ///
 fragment label brackets nonum starlevels( * 0.1 ** .05  *** .01) compress style(tab) keep(2.treatment) substitute("=1" "" "=2" "") collabels(none) cells(b(star fmt(%9.3f)) ci(par("[" ", " "]") fmt(%9.3f))) ///
 mtitles("\shortstack{New SIM Accounts\\per Market Day}" "\shortstack{New M-Pesa Accounts\\per Market Day}" "\shortstack{M-Pesa Used\\per Market Day}" "\shortstack{M-Pesa Conversion Rate\\per Market Day}") ///
 prehead("\begin{sidewaystable}[htb] \begin{center} \def\sym#1{\ifmmode^{#1}\else\(^{#1}\)\fi} \caption{Male TSR vs. Female TSR - Market-Day Level} \label{tab: Table2} \begin{adjustbox}{max width=\textwidth,max height=\textheight} \tabcolsep=0.1cm \makeatletter \providecommand{\tabularnewline}{\\} \makeatother \begin{tabular}{lcccc}\toprule") ///
 posthead("\midrule \multicolumn{3}{l}{\textbf{A: All Clients}} \\") nogaps ///
 stats(N ymean, fmt(0 2) labels("Observations" "Control Mean")) ///
 sfmt(%9.2f) varwidth(25)  replace
 
*PANEL B: CLIENT SEX
esttab est5 est6 est7 est8 using "Table_2_F.tex", ///
 fragment label brackets nonum nomtitles starlevels( * 0.1 ** .05  *** .01) compress style(tab) keep(2.treatment) substitute("=1" "" "=2" "") collabels(none) cells(b(star fmt(%9.3f)) ci(par("[" ", " "]") fmt(%9.3f))) ///
 posthead("\midrule \multicolumn{3}{l}{\textbf{B: Female Clients}} \\") nogaps ///
 stats(N ymean, fmt(0 2) labels("Observations" "Control Mean")) ///
 sfmt(%9.2f) varwidth(25)  append
 
*PANEL C: RURAL CLIENTS
esttab est9 est10 est11 est12 using "Table_2_F.tex", ///
 fragment label brackets nonum nomtitles starlevels( * 0.1 ** .05  *** .01) compress style(tab) keep(2.treatment) substitute("=1" "" "=2" "") collabels(none) cells(b(star fmt(%9.3f)) ci(par("[" ", " "]") fmt(%9.3f))) ///
 posthead("\midrule \multicolumn{3}{l}{\textbf{C: Rural Clients}} \\") nogaps ///
 stats(N ymean, fmt(0 2) labels("Observations" "Control Mean")) ///
 sfmt(%9.2f) varwidth(25) append

*PANEL D: RURAL FEMALE CLIENTS
esttab est13 est14 est15 est16 using "Table_2_F.tex", ///
 fragment label brackets nonum nomtitles starlevels( * 0.1 ** .05  *** .01) compress style(tab) keep(2.treatment) substitute("=1" "" "=2" "") collabels(none) cells(b(star fmt(%9.3f)) ci(par("[" ", " "]") fmt(%9.3f))) ///
 posthead("\midrule \multicolumn{3}{l}{\textbf{D: Rural Female Clients}} \\") nogaps ///
 stats(N ymean, fmt(0 2) labels("Observations" "Control Mean")) ///
 postfoot("\midrule Controls & $\checkmark$ & $\checkmark$ & $\checkmark$ & $\checkmark$ \tabularnewline Market FE & $\checkmark$ & $\checkmark$ & $\checkmark$ & $\checkmark$ \tabularnewline Day of Week FE & $\checkmark$ & $\checkmark$ & $\checkmark$ & $\checkmark$ \tabularnewline \bottomrule \end{tabular} \end{adjustbox} \end{center} The unit of analysis is the market day. All models are estimated using ordinary least squares models, with 95 percent confidence intervals presented in brackets. Covariates in adjusted models include whether the incentive was implemented, market and day of the week fixed effects. Heteroskedastic-robust standard errors are presented. *** p < 0.01, ** p < 0.05, * p < 0.1. \end{sidewaystable}") ///
 sfmt(%9.2f) varwidth(25) append

filefilter "Table_2_F.tex" "Table_2.tex", from( "\BShline" ) to("") replace

eststo clear
est drop _all

****************************************
***INTERACTION WITH CLIENT SEX
****************************************

*KEEP
***TABLE A6: INTERACTION ANALYSIS

eststo clear
eststo: reg tot_clients_md i.treatment##c.sub_sex##i.far_market $covariates_2 if treatment > 0, robust
sum tot_clients_md if treatment==1
estadd scalar ymean = r(mean)
eststo: reg tot_mpesa_clients_md i.treatment##c.sub_sex##i.far_market $covariates_2 if treatment > 0, robust
sum tot_mpesa_clients_md if treatment==1
estadd scalar ymean = r(mean)
eststo: reg tot_mpesa_use_md i.treatment##c.sub_sex##i.far_market $covariates_2 if treatment > 0, robust
sum tot_mpesa_use_md if treatment==1
estadd scalar ymean = r(mean)
eststo: reg mpesa_conv i.treatment##c.sub_sex##i.far_market $covariates_2 if treatment > 0, robust
sum mpesa_conv if treatment==1
estadd scalar ymean = r(mean)

esttab est1 est2 est3 est4 using "Table_A6.tex", replace fragment label nonumbers nolines cells(b(star fmt(%9.3f)) ///
ci(par("[" ", " "]") fmt(%9.3f))) starlevels(* 0.1 ** 0.05 *** 0.01) compress style(tab) keep(2.treatment sub_sex 2.treatment#c.sub_sex 1.far_market 2.treatment#1.far_market 1.far_market#c.sub_sex 2.treatment#1.far_market#c.sub_sex) substitute("=1" "" "=2" "") collabels(none) ///
stats(N ymean, fmt(0 2) labels("Observations" "Control Mean")) ///
prehead("\begin{sidewaystable}[htb] \begin{center} \caption{Interaction Analysis, Male TSR vs. Female TSR - Market-Day Level} \label{tab: TableA6} \begin{adjustbox}{max width=\textwidth,max height=\textheight} \tabcolsep=0.1cm \makeatletter \providecommand{\tabularnewline}{\\} \makeatother \begin{tabular}{lcccc}\toprule") ///
posthead("\midrule") ///
postfoot("\midrule Controls & $\checkmark$ & $\checkmark$ & $\checkmark$ & $\checkmark$ \tabularnewline Market FE & $\checkmark$ & $\checkmark$ & $\checkmark$ & $\checkmark$ \tabularnewline Day of Week FE & $\checkmark$ & $\checkmark$ & $\checkmark$ & $\checkmark$ \tabularnewline \bottomrule \end{tabular} \end{adjustbox} \end{center} The unit of analysis is the market day. All models are estimated using ordinary least squares models, with 95 percent confidence intervals presented in brackets. Covariates in adjusted models include whether the incentive was implemented, market and day of the week fixed effects. Heteroskedastic-robust standard errors are presented. *** p < 0.01, ** p < 0.05, * p < 0.1. \end{sidewaystable}") nogaps ///
mtitles("\shortstack{New SIM Accounts\\per Market Day}" "\shortstack{New M-Pesa Accounts\\per Market Day}" "\shortstack{M-Pesa Used\\per Market Day}" "\shortstack{M-Pesa Conversion Rate\\per Market Day}")


********************************************************************************
***STRATIFIED ANALYSIS OF INCENTIVE
********************************************************************************

*KEEP
***TABLE A5: PRE- AND POST-INCENTIVE

***PRE-INCENTIVE
eststo clear
eststo: reg tot_clients_md i.treatment $covariates_2 if treatment > 0 & incentive_day==0, robust
sum tot_clients_md if treatment==1
estadd scalar ymean = r(mean)
eststo: reg tot_mpesa_clients_md i.treatment $covariates_2 if treatment > 0 & incentive_day==0, robust
sum tot_mpesa_clients_md if treatment==1
estadd scalar ymean = r(mean)
eststo: reg tot_mpesa_use_md i.treatment $covariates_2 if treatment > 0 & incentive_day==0, robust
sum tot_mpesa_use_md if treatment==1
estadd scalar ymean = r(mean)
eststo: reg mpesa_conv i.treatment $covariates_2 if treatment > 0 & incentive_day==0, robust
sum mpesa_conv if treatment==1
estadd scalar ymean = r(mean)

esttab est1 est2 est3 est4 using "Table_A5.tex", replace fragment label nonumbers nolines cells(b(star fmt(%9.3f)) ///
ci(par("[" ", " "]") fmt(%9.3f))) starlevels(* 0.1 ** 0.05 *** 0.01) compress style(tab) keep(2.treatment) substitute("=1" "" "=2" "") collabels(none) ///
stats(N ymean, fmt(0 2) labels("Observations" "Control Mean")) ///
prehead("\begin{sidewaystable}[htb] \begin{center} \caption{Stratified Analysis of Male TSR vs. Female TSR by Incentive Period - Market-Day Level} \label{tab: TableA5} \begin{adjustbox}{max width=\textwidth,max height=\textheight} \tabcolsep=0.1cm \makeatletter \providecommand{\tabularnewline}{\\} \makeatother \begin{tabular}{lcccc}\toprule") ///
posthead("\midrule \multicolumn{3}{l}{\textbf{A: Pre-Incentive Period}} \\") nogaps ///
mtitles("\shortstack{New SIM Accounts\\per Market Day}" "\shortstack{New M-Pesa Accounts\\per Market Day}" "\shortstack{M-Pesa Used\\per Market Day}" "\shortstack{M-Pesa Conversion Rate\\per Market Day}")

***POST-INCENTIVE
eststo clear
eststo: reg tot_clients_md i.treatment $covariates_2 if treatment > 0 & incentive_day==1, robust
sum tot_clients_md if treatment==1
estadd scalar ymean = r(mean)
eststo: reg tot_mpesa_clients_md i.treatment $covariates_2 if treatment > 0 & incentive_day==1, robust
sum tot_mpesa_clients_md if treatment==1
estadd scalar ymean = r(mean)
eststo: reg tot_mpesa_use_md i.treatment $covariates_2 if treatment > 0 & incentive_day==1, robust
sum tot_mpesa_use_md if treatment==1
estadd scalar ymean = r(mean)
eststo: reg mpesa_conv i.treatment $covariates_2 if treatment > 0 & incentive_day==1, robust
sum mpesa_conv if treatment==1
estadd scalar ymean = r(mean)

esttab est1 est2 est3 est4 using "Table_A5.tex", append fragment label nonumbers nolines nomtitles cells(b(star fmt(%9.3f)) ///
ci(par("[" ", " "]") fmt(%9.3f))) starlevels(* 0.1 ** 0.05 *** 0.01) compress style(tab) keep(2.treatment) substitute("=1" "" "=2" "") collabels(none) ///
stats(N ymean, fmt(0 2) labels("Observations" "Control Mean")) ///
posthead("\midrule \multicolumn{3}{l}{\textbf{B: Post-Incentive Period}} \\") nogaps ///
postfoot("\midrule Controls & $\checkmark$ & $\checkmark$ & $\checkmark$ & $\checkmark$ \tabularnewline Market FE & $\checkmark$ & $\checkmark$ & $\checkmark$ & $\checkmark$ \tabularnewline Day of Week FE & $\checkmark$ & $\checkmark$ & $\checkmark$ & $\checkmark$ \tabularnewline \bottomrule \end{tabular} \end{adjustbox} \end{center} The unit of analysis is the market day. All models are estimated using ordinary least squares models, with 95 percent confidence intervals presented in brackets. Covariates in adjusted models include market and day of the week fixed effects. Heteroskedastic-robust standard errors are presented. *** p < 0.01, ** p < 0.05, * p < 0.1. \end{sidewaystable}") nogaps

****************************************
***CLIENT SEX AND RURAL OUTCOMES
****************************************

global covariates_3 "ib1.market ib0.day_wk"

*KEEP
*************************************************
***TABLE A9: HETEROGENEITY BY TSR GROUPS - FEMALE AND MALE
*************************************************

encode tsr_group, gen(tsr_group_r)

***FEMALE GROUP A VS MALE GROUP B (HIGH F VS HIGH M)

eststo clear
eststo: reg tot_clients_md i.treatment $covariates_2 if treatment > 0 & (tsr_group_r==1 | tsr_group_r==4), robust
sum tot_clients_md if treatment==1
estadd scalar ymean = r(mean)
eststo: reg tot_mpesa_clients_md i.treatment $covariates_2 if treatment > 0 & (tsr_group_r==1 | tsr_group_r==4), robust
sum tot_mpesa_clients_md if treatment==1
estadd scalar ymean = r(mean)
eststo: reg tot_mpesa_use_md i.treatment $covariates_2 if treatment > 0 & (tsr_group_r==1 | tsr_group_r==4), robust
sum tot_mpesa_use_md if treatment==1
estadd scalar ymean = r(mean)
eststo: reg mpesa_conv i.treatment $covariates_2 if treatment > 0 & (tsr_group_r==1 | tsr_group_r==4), robust
sum mpesa_conv if treatment==1
estadd scalar ymean = r(mean)

esttab est1 est2 est3 est4 using "Table_A9.tex", replace fragment label nonumbers nolines cells(b(star fmt(%9.3f)) ///
ci(par("[" ", " "]") fmt(%9.3f))) starlevels(* 0.1 ** 0.05 *** 0.01) compress style(tab) keep(2.treatment) substitute("=1" "" "=2" "") collabels(none) ///
stats(N ymean, fmt(0 2) labels("Observations" "Control Mean")) ///
prehead("\begin{sidewaystable}[htb] \begin{center} \caption{Comparison of TSR Team Performance: Market-Day Level} \label{tab: TableA9} \begin{adjustbox}{max width=\textwidth,max height=\textheight} \tabcolsep=0.1cm \makeatletter \providecommand{\tabularnewline}{\\} \makeatother \begin{tabular}{lcccc}\toprule") ///
posthead("\midrule \multicolumn{3}{l}{\textbf{A: Male TSR Group B (High) vs. Female TSR Group A (High)}} \\") nogaps ///
mtitles("\shortstack{New SIM Accounts\\per Market Day}" "\shortstack{New M-Pesa Accounts\\per Market Day}" "\shortstack{M-Pesa Used\\per Market Day}" "\shortstack{M-Pesa Conversion Rate\\per Market Day}")


***FEMALE GROUP B VS MALE GROUP B (LOW F VS HIGH M)

eststo clear
eststo: reg tot_clients_md i.treatment $covariates_2 if treatment > 0 & (tsr_group_r==2 | tsr_group_r==4), robust
sum tot_clients_md if treatment==1
estadd scalar ymean = r(mean)
eststo: reg tot_mpesa_clients_md i.treatment $covariates_2 if treatment > 0 & (tsr_group_r==2 | tsr_group_r==4), robust
sum tot_mpesa_clients_md if treatment==1
estadd scalar ymean = r(mean)
eststo: reg tot_mpesa_use_md i.treatment $covariates_2 if treatment > 0 & (tsr_group_r==2 | tsr_group_r==4), robust
sum tot_mpesa_use_md if treatment==1
estadd scalar ymean = r(mean)
eststo: reg mpesa_conv i.treatment $covariates_2 if treatment > 0 & (tsr_group_r==2 | tsr_group_r==4), robust
sum mpesa_conv if treatment==1
estadd scalar ymean = r(mean)

esttab est1 est2 est3 est4 using "Table_A9.tex", append fragment label nonumbers nolines nomtitles cells(b(star fmt(%9.3f)) ///
ci(par("[" ", " "]") fmt(%9.3f))) starlevels(* 0.1 ** 0.05 *** 0.01) compress style(tab) keep(2.treatment) substitute("=1" "" "=2" "") collabels(none) ///
stats(N ymean, fmt(0 2) labels("Observations" "Control Mean")) ///
posthead("\midrule \multicolumn{3}{l}{\textbf{B: Male TSR Group B (High) vs. Female TSR Group B (Low)}} \\") nogaps


***FEMALE GROUP A VS MALE GROUP A (HIGH F VS LOW M)

eststo clear
eststo: reg tot_clients_md i.treatment $covariates_2 if treatment > 0 & (tsr_group_r==1 | tsr_group_r==3), robust
sum tot_clients_md if treatment==1
estadd scalar ymean = r(mean)
eststo: reg tot_mpesa_clients_md i.treatment $covariates_2 if treatment > 0 & (tsr_group_r==1 | tsr_group_r==3), robust
sum tot_mpesa_clients_md if treatment==1
estadd scalar ymean = r(mean)
eststo: reg tot_mpesa_use_md i.treatment $covariates_2 if treatment > 0 & (tsr_group_r==1 | tsr_group_r==3), robust
sum tot_mpesa_use_md if treatment==1
estadd scalar ymean = r(mean)
eststo: reg mpesa_conv i.treatment $covariates_2 if treatment > 0 & (tsr_group_r==1 | tsr_group_r==3), robust
sum mpesa_conv if treatment==1
estadd scalar ymean = r(mean)

esttab est1 est2 est3 est4 using "Table_A9.tex", append fragment label nonumbers nolines nomtitles cells(b(star fmt(%9.3f)) ///
ci(par("[" ", " "]") fmt(%9.3f))) starlevels(* 0.1 ** 0.05 *** 0.01) compress style(tab) keep(2.treatment) substitute("=1" "" "=2" "") collabels(none) ///
stats(N ymean, fmt(0 2) labels("Observations" "Control Mean")) ///
posthead("\midrule \multicolumn{3}{l}{\textbf{C: Male TSR Group A (Low) vs. Female TSR Group A (High)}} \\") nogaps


***FEMALE GROUP B VS MALE GROUP B (LOW F VS LOW M)

eststo clear
eststo: reg tot_clients_md i.treatment $covariates_2 if treatment > 0 & (tsr_group_r==2 | tsr_group_r==3), robust
sum tot_clients_md if treatment==1
estadd scalar ymean = r(mean)
eststo: reg tot_mpesa_clients_md i.treatment $covariates_2 if treatment > 0 & (tsr_group_r==2 | tsr_group_r==3), robust
sum tot_mpesa_clients_md if treatment==1
estadd scalar ymean = r(mean)
eststo: reg tot_mpesa_use_md i.treatment $covariates_2 if treatment > 0 & (tsr_group_r==2 | tsr_group_r==3), robust
sum tot_mpesa_use_md if treatment==1
estadd scalar ymean = r(mean)
eststo: reg mpesa_conv i.treatment $covariates_2 if treatment > 0 & (tsr_group_r==2 | tsr_group_r==3), robust
sum mpesa_conv if treatment==1
estadd scalar ymean = r(mean)

esttab est1 est2 est3 est4 using "Table_A9.tex", append fragment label nonumbers nolines nomtitles cells(b(star fmt(%9.3f)) ///
ci(par("[" ", " "]") fmt(%9.3f))) starlevels(* 0.1 ** 0.05 *** 0.01) compress style(tab) keep(2.treatment) substitute("=1" "" "=2" "") collabels(none) ///
stats(N ymean, fmt(0 2) labels("Observations" "Control Mean")) ///
posthead("\midrule \multicolumn{3}{l}{\textbf{D: Male TSR Group B (Low) vs. Female TSR Group B (Low)}} \\") nogaps


***FEMALE GROUP A VS FEMALE GROUP B (HIGH F VS LOW F)

eststo clear
eststo: reg tot_clients_md i.tsr_group_r $covariates_2 if treatment > 0 & (tsr_group_r==1 | tsr_group_r==2), robust
sum tot_clients_md if tsr_group_r==1
estadd scalar ymean = r(mean)
eststo: reg tot_mpesa_clients_md i.tsr_group_r $covariates_2 if treatment > 0 & (tsr_group_r==1 | tsr_group_r==2), robust
sum tot_mpesa_clients_md if tsr_group_r==1
estadd scalar ymean = r(mean)
eststo: reg tot_mpesa_use_md i.tsr_group_r $covariates_2 if treatment > 0 & (tsr_group_r==1 | tsr_group_r==2), robust
sum tot_mpesa_use_md if tsr_group_r==1
estadd scalar ymean = r(mean)
eststo: reg mpesa_conv i.tsr_group_r $covariates_2 if treatment > 0 & (tsr_group_r==1 | tsr_group_r==2), robust
sum mpesa_conv if tsr_group_r==1
estadd scalar ymean = r(mean)

esttab est1 est2 est3 est4 using "Table_A9.tex", append fragment label nonumbers nolines nomtitles cells(b(star fmt(%9.3f)) ///
ci(par("[" ", " "]") fmt(%9.3f))) starlevels(* 0.1 ** 0.05 *** 0.01) compress style(tab) keep(2.tsr_group_r) substitute("=1" "" "=2" "") collabels(none) ///
stats(N ymean, fmt(0 2) labels("Observations" "Control Mean")) ///
posthead("\midrule \multicolumn{3}{l}{\textbf{E: Female TSR Group A (High) vs. Female TSR Group B (Low)}} \\") nogaps


***MALE GROUP A VS MALE GROUP B (LOW M VS HIGH M)

eststo clear
eststo: reg tot_clients_md i.tsr_group_r $covariates_2 if treatment > 0 & (tsr_group_r==3 | tsr_group_r==4), robust
sum tot_clients_md if tsr_group_r==3
estadd scalar ymean = r(mean)
eststo: reg tot_mpesa_clients_md i.tsr_group_r $covariates_2 if treatment > 0 & (tsr_group_r==3 | tsr_group_r==4), robust
sum tot_mpesa_clients_md if tsr_group_r==3
estadd scalar ymean = r(mean)
eststo: reg tot_mpesa_use_md i.tsr_group_r $covariates_2 if treatment > 0 & (tsr_group_r==3 | tsr_group_r==4), robust
sum tot_mpesa_use_md if tsr_group_r==3
estadd scalar ymean = r(mean)
eststo: reg mpesa_conv i.tsr_group_r $covariates_2 if treatment > 0 & (tsr_group_r==3 | tsr_group_r==4), robust
sum mpesa_conv if tsr_group_r==3
estadd scalar ymean = r(mean)

esttab est1 est2 est3 est4 using "Table_A9.tex", append fragment label nonumbers nolines nomtitles cells(b(star fmt(%9.3f)) ///
ci(par("[" ", " "]") fmt(%9.3f))) starlevels(* 0.1 ** 0.05 *** 0.01) compress style(tab) keep(4.tsr_group_r) substitute("=1" "" "=2" "" "=4" "") collabels(none) ///
stats(N ymean, fmt(0 2) labels("Observations" "Control Mean")) ///
posthead("\midrule \multicolumn{3}{l}{\textbf{F: Male TSR Group A (Low) vs. Male TSR Group B (High)}} \\") nogaps ///
postfoot("\midrule Controls & $\checkmark$ & $\checkmark$ & $\checkmark$ & $\checkmark$ \tabularnewline Market FE & $\checkmark$ & $\checkmark$ & $\checkmark$ & $\checkmark$ \tabularnewline Day of Week FE & $\checkmark$ & $\checkmark$ & $\checkmark$ & $\checkmark$ \tabularnewline \bottomrule \end{tabular} \end{adjustbox} \end{center} The unit of analysis is the market day. All models are estimated using ordinary least squares models, with 95 percent confidence intervals presented in brackets. Covariates in adjusted models include whether the incentive was implemented, market and day of the week fixed effects. Heteroskedastic-robust standard errors are presented. *** p < 0.01, ** p < 0.05, * p < 0.1. \end{sidewaystable}") nogaps

*************************************************
***SUPPLEMENTARY MATERIALS
*************************************************

*KEEP
*************************************************
***TABLE B3: RANDOMIZATION INFERENCE - MAIN EFFECTS ONLY
*************************************************

eststo clear

gen female = treatment==2

eststo clear

eststo: reg tot_clients_md female $covariates_2 if treatment > 0, robust
ritest female _b[female], reps(500) seed(6022): `e(cmdline)'
matrix pboot = r(p)
mat colnames pboot = female
estadd matrix pboot = pboot : est1
sum tot_clients_md if treatment==1
estadd scalar ymean = r(mean) : est1

eststo: reg tot_mpesa_clients_md female $covariates_2 if treatment > 0, robust
ritest female _b[female], reps(500) seed(6022): `e(cmdline)'
matrix pboot = r(p)
mat colnames pboot = female
estadd matrix pboot = pboot : est2
sum tot_mpesa_clients_md if treatment==1
estadd scalar ymean = r(mean) : est2


eststo: reg tot_mpesa_use_md female $covariates_2 if treatment > 0, robust
ritest female _b[female], reps(500) seed(6022): `e(cmdline)'
matrix pboot = r(p)
mat colnames pboot = female
estadd matrix pboot = pboot : est3
sum tot_mpesa_use_md if treatment==1
estadd scalar ymean = r(mean) : est3

eststo: reg mpesa_conv female $covariates_2 if treatment > 0, robust
ritest female _b[female], reps(500) seed(6022): `e(cmdline)'
matrix pboot = r(p)
mat colnames pboot = female
estadd matrix pboot = pboot : est4
sum mpesa_conv if treatment==1
estadd scalar ymean = r(mean) : est4

esttab est1 est2 est3 est4 using "Table_B3.tex", replace fragment label nonumbers nolines cells(b(fmt(%9.3f)) ///
pboot(fmt(%9.3f) par) p(fmt(%9.3f) par([ ]))) starlevels(* 0.1 ** 0.05 *** 0.01) compress style(tab) keep(female) substitute("=1" "" "=2" "" "=4" "") collabels(none) ///
stats(N ymean, fmt(0 2) labels("Observations" "Control Mean")) ///
prehead("\begin{sidewaystable}[htb] \begin{center} \caption{Robustness Check: Randomization Inference, Market-Day Level} \label{tab: TableB3} \begin{adjustbox}{max width=\textwidth,max height=\textheight} \tabcolsep=0.1cm \makeatletter \providecommand{\tabularnewline}{\\} \makeatother \begin{tabular}{lcccc}\toprule") ///
posthead("\midrule") ///
postfoot("\midrule Controls & $\checkmark$ & $\checkmark$ & $\checkmark$ & $\checkmark$ \tabularnewline Market FE & $\checkmark$ & $\checkmark$ & $\checkmark$ & $\checkmark$ \tabularnewline Day of Week FE & $\checkmark$ & $\checkmark$ & $\checkmark$ & $\checkmark$ \tabularnewline \bottomrule \end{tabular} \end{adjustbox} \end{center} The unit of analysis is the market day. All models are estimated using ordinary least squares models, with randomization inference-generated p-values (500 replications) presented in parentheses and standard heteroskedastic-robust p-values presented in brackets. Covariates in adjusted models include whether the incentive was implemented, market and day of the week fixed effects. \end{sidewaystable}") nogaps ///
mtitles("\shortstack{New SIM Accounts\\per Market Day}" "\shortstack{New M-Pesa Accounts\\per Market Day}" "\shortstack{M-Pesa Used\\per Market Day}" "\shortstack{M-Pesa Conversion Rate\\per Market Day}")


*KEEP
*************************************************
***TABLE B4: MULTIPLE HYPOTHESIS TESTING - MAIN EFFECTS ONLY
*************************************************

eststo clear

eststo: reg tot_clients_md female $covariates_2 if treatment > 0, robust
sum tot_clients_md if treatment==1
estadd scalar ymean = r(mean) : est1

eststo: reg tot_mpesa_clients_md female $covariates_2 if treatment > 0, robust
sum tot_mpesa_clients_md if treatment==1
estadd scalar ymean = r(mean) : est2

eststo: reg tot_mpesa_use_md female $covariates_2 if treatment > 0, robust
sum tot_mpesa_use_md if treatment==1
estadd scalar ymean = r(mean) : est3

eststo: reg mpesa_conv female $covariates_2 if treatment > 0, robust
sum mpesa_conv if treatment==1
estadd scalar ymean = r(mean) : est4

*CLUSTERING AT THE MARKET LEVEL

reg tot_clients_md female $covariates_2 if treatment > 0, vce(cluster market)
test female
matrix pclust = r(p)
mat colnames pclust = female
estadd matrix pclust = pclust : est1

reg tot_mpesa_clients_md female $covariates_2 if treatment > 0, vce(cluster market)
test female
matrix pclust = r(p)
mat colnames pclust = female
estadd matrix pclust = pclust : est2

reg tot_mpesa_use_md female $covariates_2 if treatment > 0, vce(cluster market)
test female
matrix pclust = r(p)
mat colnames pclust = female
estadd matrix pclust = pclust : est3

reg mpesa_conv female $covariates_2 if treatment > 0, vce(cluster market)
test female
matrix pclust = r(p)
mat colnames pclust = female
estadd matrix pclust = pclust : est4

*MHT USING rwolf2 COMMAND (ROMANO-WOLF)

rwolf2 (reg tot_clients_md		 	female $covariates_2 if treatment > 0, robust ) /// 
	   (reg tot_mpesa_clients_md 	female $covariates_2 if treatment > 0, robust ) /// 
	   (reg tot_mpesa_use_md	 	female $covariates_2 if treatment > 0, robust ) /// 
       (reg mpesa_conv			 	female $covariates_2 if treatment > 0, robust ), ///  
	   indepvars(female, female, female, female) reps(500) holm seed(6022)

matrix rw_all = e(RW)

forvalues i=1/4 {
matrix prw = rw_all[`i',3]
mat colnames prw = female
estadd matrix prw = prw : est`i'
matrix holm = rw_all[`i',4]
mat colnames holm = female
estadd matrix holm = holm : est`i'

}

esttab est1 est2 est3 est4 using "Table_B4.tex", replace fragment label nonumbers nolines cells(b(fmt(%9.3f)) ///
prw(fmt(%9.3f) par) holm(fmt(%9.3f) par(< >)) pclust(fmt(%9.3f) par(| |)) p(fmt(%9.3f) par([ ]))) starlevels(* 0.1 ** 0.05 *** 0.01) compress style(tab) keep(female) substitute("=1" "" "=2" "" "=4" "") collabels(none) ///
stats(N ymean, fmt(0 2) labels("Observations" "Control Mean")) ///
prehead("\begin{sidewaystable}[htb] \begin{center} \caption{Robustness Check: Multiple Hypothesis Testing, Market-Day Level} \label{tab: TableB4} \begin{adjustbox}{max width=\textwidth,max height=\textheight} \tabcolsep=0.1cm \makeatletter \providecommand{\tabularnewline}{\\} \makeatother \begin{tabular}{lcccc}\toprule") ///
posthead("\midrule") ///
postfoot("\midrule Controls & $\checkmark$ & $\checkmark$ & $\checkmark$ & $\checkmark$ \tabularnewline Market FE & $\checkmark$ & $\checkmark$ & $\checkmark$ & $\checkmark$ \tabularnewline Day of Week FE & $\checkmark$ & $\checkmark$ & $\checkmark$ & $\checkmark$ \tabularnewline \bottomrule \end{tabular} \end{adjustbox} \end{center} The unit of analysis is the market day. All models are estimated using ordinary least squares models, corrected for multiple hypothesis testing using the Romano-Wolf correction in parentheses (500 replications), the Holm correction in angled brackets (500 replications), market-level clustered p-values in vertical brackets, and standard heteroskedastic-robust p-values in square brackets. Covariates in adjusted models include whether the incentive was implemented, market and day of the week fixed effects. \end{sidewaystable}") nogaps ///
mtitles("\shortstack{New SIM Accounts\\per Market Day}" "\shortstack{New M-Pesa Accounts\\per Market Day}" "\shortstack{M-Pesa Used\\per Market Day}" "\shortstack{M-Pesa Conversion Rate\\per Market Day}")
